#include <bits/stdc++.h>
using namespace std;
class singleton
{ private:
  singleton()=default;
  ~singleton()=default;
 int data=0;
 public:
    static singleton & getInstance()
    {   static singleton instance;
        return instance;
    }
    void inc()
    {
        data=data+1;
    }
    void prt()
    {
        cout<<data<<"\n";
    }
};
int main()
{
    singleton &a=singleton::getInstance();
    singleton &b=singleton::getInstance();
    b.prt();
    a.inc();
    b.prt();

}